//弹窗
export const toggle = {
    data() {
        return {
            //1初始化状态
            info: {
                isshow: true,
                isAdd: true
            },
        }
    },
    methods: {
        //添加
        willAdd() {
            this.info.isshow = true
            this.info.isAdd = true
        },
        //点击编辑
        willUpdate(id) {
            this.info.isshow = true
            this.info.isAdd = false
            //让form调用发请求
            this.$refs.form.getOne(id)
        },
    }
}

//form关闭弹窗
export const formClose = {
    methods: {
        //取消
        cancel() {
            this.info.isshow = false;
        },
        //关闭弹窗
        close() {
            if (!this.info.isAdd) {
                this.empty();
            }
        }
    }
}